package 算法.leetcode.offer;

/**
 * @author lchenglong
 * @date 2022/3/20
 */
public class Offer65 {

    public static void main(String[] args) {
        Offer65 instance = new Offer65();
        int add = instance.add(1, 2);
        System.out.println(add);
    }
    public int add(int a, int b) {
        while (b!=0){
            int c = (a&b)<<1;
            a = a^ b;
            b=c;
        }
        return a;
    }
}
